<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <script src="js/jquery1.42.min.js"></script>
    <style>
      div {
        width: 100px;
        height: 100px;
        background-color: pink;
      }
    </style>
  </head>
  <body>
    <div></div>
    <hr />
    <button id="show">显示</button>
    <button id="hide">隐藏</button>
    <button id="toggle">切换</button>
    <script>
      $("#show").click(function () {
        $("div").show();
      });
      $("#hide").click(function () {
        $("div").hide();
      });
      $("#toggle").click(function () {
        $("div").toggle(2000, function () {
          alert("执行完成才会弹出");
        });
      });
    </script>
  </body>
</html>
